<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <!-- 表示只有当按下的键盘码=49才会触发fn事件 -->
    <!-- <input @keyup.49="fn"> -->
    <input @keyup.esc="fn">
    <input @keyup.enter="fn">
    <input @keyup.esc.enter="fn">

  </div>
</body>
<script src="./lib/vue.js"></script>
<script>
  new Vue({
    el: "#app",
    methods: {
      fn( event ){
        console.log(event.keyCode);
      }
    }
  })
</script>
</html>